package com.boost.tjvm.oom;

/**
 * 虚拟机栈深度超长
 * 单个线程虚拟机栈深度为1000-2000 之间没问题
 */
public class JavaVMStackSOF {

    private int stackLenght =1;

    public void stackLeak(){

        stackLenght++;
        stackLeak();
    }

    public static void main(String [] args){
        //-Xss128k
        JavaVMStackSOF oom=new JavaVMStackSOF();
        try {
            oom.stackLeak();
        }catch (Throwable e){
            System.out.println("stack length:"+ oom.stackLenght);
            throw e;
        }
    }
}
